SHELL = /bin/bash

PWD ?= .
BUILDDIR ?= $(PWD)
CONTRACT_NAME=simple
CONTRACT_STORAGE_NAME=simpleStorage

solc:
	echo "solc..."
	solc-0.6.12 --bin --abi --optimize --overwrite \
	--allow-paths "$(PWD)" \
	$(PWD)/$(CONTRACT_NAME).sol -o $(BUILDDIR)

abigen:
	echo "abigen..."
	abigen --bin=$(BUILDDIR)/$(CONTRACT_STORAGE_NAME).bin \
	--abi=$(BUILDDIR)/$(CONTRACT_STORAGE_NAME).abi \
	--solc="solc-0.6.12" \
	--pkg=$(CONTRACT_NAME) \
	--out=$(BUILDDIR)/$(CONTRACT_NAME).go
